Skip to content

Conversation

@devdanzin
Copy link
Member

@devdanzin devdanzin commented Oct 19, 2024

This PR adds a guard against SyntaxError.lineno being None in code.InteractiveInterpreter._showtraceback, which should avoid PyREPL exiting the interpreter when a null byte is present in the input.

Not sure both new tests are necessary, happy to remove one or the other if it's better.

@devdanzin
Copy link
Member Author

Thank you very much! If you can, propose it as a code change and I'll accept it, so your contribution gets recorded in a commit.

@ZeroIntensity ZeroIntensity added the topic-repl Related to the interactive shell label Oct 24, 2024
@ZeroIntensity
Copy link
Member

Thank you very much! If you can, propose it as a code change and I'll accept it, so your contribution gets recorded in a commit.

That person was a bot user, sorry!

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks fine.

@pablogsal pablogsal enabled auto-merge (squash) October 27, 2024 00:54
@pablogsal
Copy link
Member

Thanks for the contribution @devdanzin and thanks @ZeroIntensity for the review!

@pablogsal pablogsal merged commit 44becb8 into python:main Oct 27, 2024
35 checks passed
@miss-islington-app
Copy link

Thanks @devdanzin for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 27, 2024
@bedevere-app
Copy link

bedevere-app bot commented Oct 27, 2024

GH-126023 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Oct 27, 2024
Yhg1s pushed a commit that referenced this pull request Dec 2, 2024
…H-125732) (#126023)

gh-125666: Avoid PyREPL exiting when a null byte is in input (GH-125732)
(cherry picked from commit 44becb8)

Co-authored-by: devdanzin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-repl Related to the interactive shell

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants